Skip to content

Conversation

@dagregi
Copy link
Contributor

@dagregi dagregi commented Dec 30, 2025

Prepare


Description

Target issue

closes #12900

Implementation Details


Test and Document the changes

  • Static code analysis has been run locally and issues have been fixed
  • Relevant unit and integration tests have been added/updated
  • Relevant documentation has been updated if any (i.e. user guides, installation and configuration guides, technical design docs etc)

Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with docs: to indicate documentation changes or if the below checklist is not selected.

  • I confirm that there is no impact on the docs due to the code changes in this PR.

Summary by CodeRabbit

  • Tests
    • Enhanced authorization benchmark validation to pre-validate requests and updated test token issuer configuration.
  • Refactor
    • Simplified request construction and removed unnecessary error handling in benchmark utilities for clearer workflow.
  • Chores
    • Adjusted benchmark checking script to apply different thresholds for specific benchmarks and improve reporting.

✏️ Tip: You can customize this high-level summary in your review settings.

@dagregi dagregi self-assigned this Dec 30, 2025
@dagregi dagregi added the comp-jans-cedarling Touching folder /jans-cedarling label Dec 30, 2025
@mo-auto
Copy link
Member

mo-auto commented Dec 30, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

📝 Walkthrough

Walkthrough

Benchmarks and a benchmark-checking script were modified: request-builder functions were made non-fallible and now accept references/issuer URLs; a pre-benchmark JWT validation helper was added; issuer strings were changed; and the benchmark threshold logic was adjusted for specific problematic benchmarks.

Changes

Cohort / File(s) Summary
Bench: request builders & validation
jans-cedarling/cedarling/benches/authz_authorize_benchmark.rs
Converted prepare_cedarling_request_for_* functions to return Request (non-Result) and to accept &KeyPair + issuer_url where applicable; added async helper validate_cedarling_works() and pre-benchmark validation calls; updated test token issuer from admin-ui-test.gluu.orgtest.jans.org; call sites updated to use references and .expect("should build request") where needed.
Script: benchmark threshold logic
jans-cedarling/scripts/check_benchmarks.py
Added EXCLUSION_THRESHOLD and PROBLEMATIC_BENCHMARKS; per-benchmark threshold selection uses the exclusion threshold for listed benchmarks and logs/reporting now reference the chosen threshold variable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(jans-cedarling): fix benchmarks to actually work' is clearly related to the main changes, which repair benchmark functionality by fixing JWT validation and token issuer configuration issues.
Description check ✅ Passed The PR description follows the template structure with all required sections completed, including linked issue (#12900), preparation checklist, and documentation confirmation.
Linked Issues check ✅ Passed The code changes directly address issue #12900 requirements: fixing JWT validation in benchmarks, updating issuer URLs from 'admin-ui-test.gluu.org' to 'test.jans.org', and adding validation checks before measurement.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing benchmarks: refactoring request builders to remove error handling, updating issuer tokens, adding validation helper, and introducing threshold logic for problematic benchmarks.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mo-auto mo-auto added the kind-bug Issue or PR is a bug in existing functionality label Dec 30, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Dec 30, 2025
The added exclusion threshold should be removed once #12947 is fixed.

Signed-off-by: dagregi <[email protected]>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @jans-cedarling/scripts/check_benchmarks.py:
- Around line 38-41: Replace the if-else threshold selection with a lookup
mapping to make it easier to extend: create BENCHMARK_THRESHOLDS mapping
specific benchmark_name keys to EXCLUSION_THRESHOLD, then set threshold =
BENCHMARK_THRESHOLDS.get(benchmark_name, THRESHOLD_NS) instead of checking
PROBLEMATIC_BENCHMARKS; keep existing constants EXCLUSION_THRESHOLD,
THRESHOLD_NS and the benchmark_name symbol to preserve behavior.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 32bfc51 and f22e1c4.

📒 Files selected for processing (1)
  • jans-cedarling/scripts/check_benchmarks.py
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: JanssenProject/jans PR: 0
File: jans-cedarling/AGENTS.md:0-0
Timestamp: 2025-12-10T08:24:27.240Z
Learning: Run benchmarks using `cargo bench -p cedarling`
Learnt from: CR
Repo: JanssenProject/jans PR: 0
File: jans-cedarling/AGENTS.md:0-0
Timestamp: 2025-12-10T08:24:27.240Z
Learning: Applies to jans-cedarling/**/*.rs : Review clippy.toml for project-specific lint rules
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: cleanup
  • GitHub Check: python_tests (3.10)
  • GitHub Check: wasm_tests
  • GitHub Check: rust_tests
  • GitHub Check: python_tests (3.11)
  • GitHub Check: golang_tests
  • GitHub Check: rust_benchmarks
🔇 Additional comments (2)
jans-cedarling/scripts/check_benchmarks.py (2)

43-50: LGTM! Threshold variable used consistently.

The threshold variable is correctly applied in the comparison and both log messages. The implementation ensures that the appropriate threshold is used for each benchmark.


10-16: Issue #12947 is open and properly tracked. The code change is a legitimate temporary measure.

The 1.5ms threshold for these specific benchmarks is justified by a documented performance bottleneck (entity building and schema validation overhead in issue #12947), not an arbitrary workaround. The code comment correctly references the issue, which contains the explanation for why these benchmarks exceed the standard 1ms threshold during this optimization phase.

@olehbozhok olehbozhok merged commit 4518da7 into main Jan 7, 2026
17 checks passed
@olehbozhok olehbozhok deleted the jans-cedarling-12900 branch January 7, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-jans-cedarling Touching folder /jans-cedarling kind-bug Issue or PR is a bug in existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(jans-cedarling): fix benchmarks to actually work

4 participants